// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Vuetify from 'vuetify'
import App from '@/App'
import router from '@/router'
import store from '@/store'
import 'babel-polyfill'

import cn from 'vee-validate/dist/locale/zh_CN'
import VeeValidate, {Validator} from 'vee-validate'

// import 'material-design-icons-iconfont/dist/material-design-icons.min.css'
// Ensure you are using css-loader

// import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.snow.css'

import 'vuetify/dist/vuetify.min.css' // Ensure you are using css-loader
import '@/assets/css/app.css'

Validator.localize('zh_CN', cn)
Vue.use(VeeValidate)

Vue.use(Vuetify)
// Vue.use(VueQuillEditor)

Vue.config.productionTip = false

Vue.filter('formatSize', function (size) {
  if (size > 1024 * 1024 * 1024 * 1024) {
    return (size / 1024 / 1024 / 1024 / 1024).toFixed(2) + ' TB'
  } else if (size > 1024 * 1024 * 1024) {
    return (size / 1024 / 1024 / 1024).toFixed(2) + ' GB'
  } else if (size > 1024 * 1024) {
    return (size / 1024 / 1024).toFixed(2) + ' MB'
  } else if (size > 1024) {
    return (size / 1024).toFixed(2) + ' KB'
  }
  return size.toString() + ' B'
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
